home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Mania 4
/
MacMania 4.toast
/
/
Tools&Utilities
/
MathPad 2.4
/
Examples
/
RLC circuit
< prev
next >
Wrap
Text File
|
1996-04-10
|
594b
|
31 lines
include ":incl:complex ops"
w = 2*π*f
db(gain) = 20*log(gain)
-- parallel impedances
par(z1,z2) = Cdiv(Cmult(z1,z2),(z1+z2))
-- complex impedance of components
zC = {0 ,-1/(w*C)}
zL = {Rs ,w*L} --Rs due to winding res
zR = {R ,0}
-- circuit is voltage divider
zgain = zout := par(zC,zR),
Cdiv(zout,(zout+zL))
-- component values
L=180u; Rs=.5
C=.2u
R=50
f=X*1K -- freq in Khz
Xmin=1; Xmax=500; Xdiv=3 --log axis
Ymin=-50; Ymax=5
plot db(Cabs(zgain)); Ylabel=" gain db"
newaxis; Ystrips=2
Ymin:=-180:; Ymax:=0:; Ydiv:=45:
Ylabel:=" phase ":; Xlabel:="Khz":
plot Carg(zgain)